<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:text="${mp.name}">页面授权登录</title>
</head>
<body>
<input type="hidden" id="authorUrl" th:value="${authorUrl}">
<input type="hidden" id="recallUrl" th:value="${recallUrl}">
<input type="hidden" id="recallParams" th:value="${recallParams}">

<script type="text/javascript">
    //初始化页，通过sessionStorage存储业务系统传来的reCallUrl、recallParam，以便于完成授权后回到业务指定的该位置及当时的参数
    document.addEventListener("DOMContentLoaded", function() {
        sessionStorage.setItem("wx_commonAuthor_recallUrl", document.getElementById("recallUrl").value);
        sessionStorage.setItem("wx_commonAuthor_recallParams", document.getElementById("recallParams").value);
        console.log("recallUrl in sessionStorage:", sessionStorage.getItem("wx_commonAuthor_recallUrl"));
        console.log("recallParams in sessionStorage:", sessionStorage.getItem("wx_commonAuthor_recallParams"));
        //静默授权则直接跳转
        window.location.href = document.getElementById("authorUrl").value;
    });


</script>
</body>
</html>